package com.springframework.beans.factory;

import java.util.HashMap;
import java.util.Map;

/**
 * ClassName: BeanFactory
 * Description:
 * BeanFactory是Spring框架的核心接口，它定义了Spring容器的基本功能。
 *
 * @author: zsg
 * @Create 2024/6/2 15:27
 */
public class BeanFactory {
    private final Map<String, Object> beanMap = new HashMap<>();


    public void registerBean(String beanName, Object bean){
        // 将bean对象注册到beanMap中
        beanMap.put(beanName, bean);
    }

    public Object getBean(String beanName){
        // 根据beanName获取bean对象
        return beanMap.get(beanName);
    }

}
